package com.shuang.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shuang.mapper.AreaMapper;
import com.shuang.pojo.Area;
import com.shuang.service.impl.AreaService;
import org.springframework.util.StringUtils;

/**
 * @DATE: 2021/09/26 15:52
 * @Author: 小爽帅到拖网速
 */

@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements AreaService {

  @Autowired
  AreaMapper areaMapper;

  @Override
  public String getAreaIdByAreaName(String areaName) {
    Area area = null;
    if (StringUtils.hasText(areaName)) {
      area = areaMapper.selectOne(new LambdaQueryWrapper<Area>().eq(Area::getAreaName, areaName));
    }
    return area.getAreaNo();
  }
}
